package com.wxyzz.canteenadmin.shop.empType.service.impl;

import com.github.pagehelper.ISelect;
import com.github.pagehelper.PageInfo;
import com.wxyzz.canteenadmin.shop.empType.mapper.EmpTypeMapper;
import com.wxyzz.canteenadmin.shop.empType.service.EmpTypeService;
import com.wxyzz.canteenadmin.shop.employee.VO.EmployeeVO;
import com.wxyzz.canteenadmin.shop.employee.param.EmployeePageParam;
import com.wxyzz.canteenadmin.shop.employee.service.EmployeeService;
import com.wxyzz.canteencommon.entity.shop.employee.EmpType;
import com.wxyzz.canteencommon.utils.RedisUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * --- 加油，努力 ---
 *
 * @Author XYP
 * @Date 2024/10/11
 * @Solgne 从想做到能做
 * @Desc
 */
@Service
public class EmpTypeServiceImpl implements EmpTypeService {
    @Autowired
    private EmpTypeMapper empTypeMapper;


    @Override
    public List<EmpType> findAllType() {
        List<EmpType> list = (List<EmpType>)RedisUtils.getValue("emp:type");
        if (list == null || list.size() == 0) {
            list = empTypeMapper.selectAllType();
            RedisUtils.setValueTimeout("emp:type", list, 24 * 3600);
        }
        return list;
    }
}
